#include <stdio.h>
#include <string.h>
#include <unistd.h>

int main()
{
    int cnt = 0;
    const char* pend = "|/-\\";
    char buffer[102];
    memset(buffer, 0, sizeof(buffer));

    while (cnt <= 100)
    {
        printf("[%-100s][%d%] %c\r", buffer, cnt, pend[cnt % 4]);
        buffer[cnt++] = '#';
        fflush(stdout);
        usleep(30000);
    }
    printf("\n");
    return 0;
}
